<?php

use Illuminate\Database\Seeder;
class SysConfigSeeder extends Seeder
{
    private $title = ["varname","info","type","value"];
    private $data = [
        ['dw_web_name','系统名称','string','Laravel后台管理系统'] ,
    ];

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
       DB::table("sys_configs")->where("id","!=",0)->delete();
        foreach($this->data as $key => $val) {
            $data = ["id"=>$key+1];
            foreach($val as $key2 => $val2) {
                $data[$this->title[$key2]] = $val2;
            }
            App\Models\SysConfig::create($data);
        }
    }
}
